package com.gitee.simons.common.utils;

import org.springframework.core.io.ClassPathResource;

import java.io.IOException;
import java.io.InputStream;

/**
 * @author jsm
 * @date 2018/12/19 12:52
 * @Description
 */
public class FileUtil {

    /**
     *
     * @param filePath resource目录下的相对路径
     * @return
     */
    public static InputStream getResourceFile(String filePath) throws IOException {
        ClassPathResource classPathResource = new ClassPathResource(filePath);
        //获取文件流
        return classPathResource.getInputStream();
    }
}
